1. Field of the Invention
The present invention relates to a system and method for monitoring a memory stack size, and more particularly, to a system and method for monitoring a memory stack size, whereby the size of a memory stack applied to an operating system of a controller for a vehicle (e.g., a hybrid vehicle) is monitored so that an overflow phenomenon of the memory stack can be prevented.
2. Description of the Related Art
Embedded systems, in which microprocessors are embedded, refer to application systems that include hardware and software that perform a particular function. These embedded systems are being utilized in the field of electronic unit control, robot control, and process control of vehicles.
In particular, the driving force of hybrid vehicles are typically controller by a plurality of control systems, such as a motor controller for controlling a motor and an inverter, a hybrid control unit (HCU) for performing overall control on a variety of types of electronic units of a vehicle, and the like. Thus, a real time operating system (RTOS) of each controller must be configured without any problems so that the overall driving performance of a vehicle can be maintained.
In some control systems, a stack type memory stack has been used in the RTOS for operating a control system for a hybrid vehicle which is one of the most frequently used resources of an embedded system. As such when a particular task uses all portions of a stack given to the task, this task invades a memory region that is not given to the task to store its own information. This is called stack overflow.
As such, a larger capacity than the size of the memory stack to which a particular system is allocated is typically required even in the RTOS for operating the control system in hybrid vehicles. However, when an address out of a defined stack region is accessed, an overflow phenomenon of the memory stack occurs.
Overflow of the memory stack has a fatal effect on the control system for the hybrid vehicle in that it causes a target for a particular function to be reset. Due to the problem of the controller, serious problems may occur in overall control and performance of the vehicle as a result of this reset.
Generally, the usage region of the memory stack may be more excessively secured than a region that is actually being used so that the overflow phenomenon of the memory stack does not occur. However, since the usage region of the memory stack is uselessly and creates a surplus of memory, this is very inefficient and is very disadvantageous in terms of cost.